<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	<script type="text/javascript">
	1:如果有n个数字,则需要排序n-1轮.
	2:每一轮都需要比较n-i次,i表示第几轮.
	var nums=[546,55,12,38,74,5,83,3,9,21,4,88]
	for(var i=0;i<nums.length-1;i++){
	for(var j=0;j<nums.length-(i+1);j++){
		if(nums[j]>nums[j+1]){
		var temp=nums[j];
		nums[j]=nums[j+1];
		nums[j+1]=temp;
		}
	}
	console.log(nums);
	}
	
	
	</script>
	</head>
	<body>
	</body>
</html>
